/* eslint-disable */
'use strict';

module.exports = app => {
    const { STRING, DATE, BIGINT, ENUM } = app.Sequelize;
    const Admin = app.model.define('admin', {
        id: { type: BIGINT, primaryKey: true, autoIncrement: true },
        username: {
            type: STRING(30),
            allowNull: false,
        },
        password: {
            type: STRING(100),
            allowNull: false,
        },
        role: {
            type: ENUM('admin', 'designer'),
            allowNull: false, 
            defaultValue: 'admin' 
        },
        created_at: DATE,
        updated_at: DATE,
    }, {
        tableName: 't_admin'
    });
    return Admin;
};
